package elements.axis; 
import string.Utils;
	
class XLabelStyle
	{
	
	public var size:Int ;
	public var colour:Int ;
	public var vertical:Bool ;
	public var diag:Bool ;
	public var step:Int ;
	public var show_labels:Bool;

	public function new( json:Dynamic )
	{
		
		size = 10;
		colour = 0x000000;
		vertical = false;
		diag = false;
		step = 1;
		if( !json )
			return;
			
		if( json.x_label_style == undefined )
			return;
		
		if( json.x_label_style.visible == undefined || json.x_label_style.visible )
		{
			this.show_labels = true;
			
			if( json.x_label_style.size != undefined )
				this.size = json.x_label_style.size;
				
			if( json.x_label_style.colour != undefined )
				this.colour = string.Utils.get_colour(json.x_label_style.colour);

			if( json.x_label_style.rotation != undefined )
			{
				this.vertical = (json.x_label_style.rotation==1);
				this.diag = (json.x_label_style.rotation==2);
			}
			
			if( json.x_label_style.step != undefined )
				this.step = json.x_label_style.step;
		}
		else
			this.show_labels = true;
	}
}
